home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 22 / CU Amiga Magazine's Super CD-ROM 22 (1998)(EMAP Images)(GB)[!][issue 1998-05].iso / PowerPC / Programming / vbcc / machines / amigappc / libsrc / stdio / fseek.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-12-30  |  483 b   |  23 lines

  1. /*
  2. ** vbcc-Amiga-PowerPC version of fseek.c
  3. **
  4. ** v0.1 04.10.97 phx
  5. */
  6.  
  7. #include <stdio.h>
  8. #include <powerup/gcclib/powerup_protos.h>
  9.  
  10. int fseek(FILE *f,long offset,int origin)
  11. {
  12.     if(!f) return(1);
  13.     if(origin==SEEK_CUR){
  14.         if(f->flags&_READ) offset-=f->count;
  15. /*        if(f->flags&_WRITE) offset+=f->count;*/
  16.     }
  17.     if(f->flags&_WRITE) _flushbuf(f);
  18.     f->flags&=~(_READ|_WRITE|_EOF);
  19.     f->count=0;
  20.     PPCSeek((BPTR)f->filehandle,offset,origin);
  21.     return(0);
  22. }
  23.